package com.my.chapter9;

public class practice7 {
    public static void main(String[] args) {
        Rodent1 r1 = new Mouse1();
        Rodent1 r2 = new Gerbil1();
        Rodent1 r3 = new Hamster1();
        r1.eat();
        r2.eat();
        r3.eat();
    }
}

interface Rodent1{
     void eat();
}

class Mouse1 implements Rodent1 {
    public void eat(){
        System.out.println("老鼠吃东西");
    }
}

class Gerbil1 implements Rodent1 {
    public void eat(){
        System.out.println("鼹鼠吃东西");
    }
}

class Hamster1 implements Rodent1 {
    public void eat(){
        System.out.println("大颊鼠吃东西");
    }
}
